﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class UI_Room_PlayerItem : MonoBehaviour {

    public Text playerName_txt, ready_txt;
    public Button ClickBtn;
    Action onClick;
    public void SetUIData(ActorData actor,bool isReady,Action onClick)
    {
        playerName_txt.text = actor.name;
        ready_txt.gameObject.SetActive(isReady);
        this.onClick = onClick;
    }
    private void Awake()
    {
        ClickBtn.onClick.AddListener(OnClickBtn);
    }

    private void OnClickBtn()
    {
        if (onClick != null)
            onClick();
    }

    private void OnEnable()
    {
        
    }
    private void OnDisable()
    {
        
    }
}
